﻿<html>
<head>
    <script src="../extern/svg.js"></script>
    <script src="../extern/svg.draggable.js"></script>
    <script src="../cola.min.js"></script>
    <script src="rectangletest.js"></script>
</head>
<body>
    <a href="../index.html">cola.js home</a>
    <p>This demo uses svg.js to draw a bunch of rectangles and svg.draggable.js to make them draggable.
        On each drag event, we use VPSC to remove overlaps between rectangles while displacing them as little as possible.
    </p>
    <button type="button" onclick="removeOverlaps(rs)">Remove overlaps</button>
    Try dragging the rectangles... 
    <!--<button type="button" onclick="undo()">undo</button>-->
    Use the slider to make more...
    <input id="rectCountSlider" type="range" min="5" max="50" value="20" onchange="updateRectCount(this.value)"/>
    <button type="button" onclick="rs = drawRects()">Random Shuffle</button> 
    Animate <input type="checkbox" onchange="toggleAnimation()" />
    <div id="canvas"></div>
    <div id="dump"></div>
    <script>init(); rs = drawRects()</script>
    <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-63535113-1', 'auto');
  ga('send', 'pageview');

    </script>
</body>
</html>